<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入主题样式 -->
<link
	href="${pageContext.request.contextPath }/themes/bootstrap/easyui.css"
	rel="stylesheet">
<!-- 引入图标的样式 -->
<link href="${pageContext.request.contextPath }/themes/icon.css"
	rel="stylesheet">
<!-- 先引入jquery -->
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-1.7.2.js"></script>
<!-- 引入easyui.js -->
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
	$(function() {

		//配置登录窗口
		$('#loginWin').window({
			width : 600,
			height : 400,
			title : '',
			collapsible : false,
			minimizable : false,
			maximizable : false,
			closable : false,
			draggable : false,
			resizable : false,
			shadow:true,
			border:false
		});
		
		//配置登录表单
		$('#ff').form({
			url : 'login',
			success : function(data) {
				var data = eval('(' + data + ')');
				$('#ff').form('clear');
				if (data.success) {
					location.href = 'main.jsp';
				} else {
					$.messager.alert('提示信息', data.msg, 'info', function() {
						location.href = 'login.jsp';
					});
				}
			}
		});
		
		//配置登录表单的text、password、button
		$('#tid').textbox({
			height : 30,
			prompt : '请输入用户名',
		})
		$('#tpsw').textbox({
			height : 30,
			prompt : '请输入用户密码',
		})
		
		//配置提交按钮
		$('#login').linkbutton({
			iconCls : 'icon-ok',
			onClick : function() {
				$('#ff').form('submit');
			}
		});
		
		//看不清，换一张
		$('#image').click(function(){
			$.ajax({
				url:'image',//加载验证码
				type:'post'
			})
		})
		
	});
</script>

<body style="background-image: url('image/LoginImage.jpg');background-size: 100%;">
	<div id="loginWin" style="background-image:url('image/LoginImage.png');background-size: 100%; ">
		<form id="ff" method="post">
			<div style="margin-top: 120px;margin-left:120px">
				<div>
					<label for="name">&nbsp;&nbsp;用户名&nbsp;:</label><input id="uname"
						name="uname" type="text" style="width: 200px">
				</div>
				<br>
				<div>
					<label for="email">用户密码:</label><input id="upsw" name="upsw"
						type="password" style="width: 200px">
				</div>
				<div>
					<label for="name">&nbsp;&nbsp;验证码:&nbsp;:</label><input id="image" name="image"
						type="text" style="width: 200px"><img src="${pageContext.request.contextPath }/image"><a id="image" href="">看不清,换一张</a>
				</div>
				<div style="margin-left: 120px">
					<a id="login" href="#">登录</a>
				</div>
			</div>
		</form>
	</div>
</body>
</html>